<?php


namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Circle extends Model
{
    protected $table   = 'mini_circle';

    protected $guarded = [];

    protected $casts = [
        'created_at' => 'datetime:Y-m-d H:i:s'
    ];

    //用户关联
    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    //评论关联
    public function comment()
    {
        return $this->hasMany(Comment::class, 'circle_id', 'id');
    }
}
